package com.slz3.business.module.memberManagement.memAppKey.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memAppKey.domain.MemAppKey;
import com.slz3.business.module.memberManagement.memAppKey.domain.MemAppKeyCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemAppKeyResController extends MemAppKeyResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, MemAppKey memAppKey) {
        if (MemAppKeyResUnsafeValid.add(req, memAppKey)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$MemAppKeyUpdateLock(req, memAppKey);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, MemAppKeyCondition memAppKeyCondition) {
        if (MemAppKeyResUnsafeValid.delete(req, memAppKeyCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$MemAppKeyUpdateLock(req, memAppKeyCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, MemAppKey memAppKey) {
        if (MemAppKeyResUnsafeValid.modify(req, memAppKey)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$MemAppKeyUpdateLock(req, memAppKey);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (MemAppKeyResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return memAppKeyResAtomic.info_$MemAppKeyUpdateLock(req);
        if (MemAppKeyResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$MemAppKeyUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (MemAppKeyResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, MemAppKeyCondition memAppKeyCondition) {
        //
        if (MemAppKeyResUnsafeValid.auditSubmit(req, memAppKeyCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$MemAppKeyUpdateLock(req, memAppKeyCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, MemAppKeyCondition memAppKeyCondition) {
        if (MemAppKeyResUnsafeValid.audit(req, memAppKeyCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$MemAppKeyUpdateLock(req, memAppKeyCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, MemAppKeyCondition memAppKeyCondition) {
        if (MemAppKeyResUnsafeValid.auditReject(req, memAppKeyCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$MemAppKeyUpdateLock(req, memAppKeyCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, MemAppKeyCondition memAppKeyCondition) {
        if (MemAppKeyResUnsafeValid.usingEnable(req, memAppKeyCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$MemAppKeyUpdateLock(req, memAppKeyCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, MemAppKeyCondition memAppKeyCondition) {
        if (MemAppKeyResUnsafeValid.usingDisable(req, memAppKeyCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$MemAppKeyUpdateLock(req, memAppKeyCondition);
        }
    }

}
